package com.gmp.product.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gmp.common.annotation.Excel;
import com.gmp.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


/**
 * 生产指令对象 production_order
 *
 * @author Koi
 * @date 2025-09-23
 */
@TableName(resultMap = "com.gmp.product.mapper.ProductionOrderMapper.ProductionOrderResult")
public class ProductionOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 批生产指令编号
     */
    @Excel(name = "批生产指令编号")
    private String orderCode;

    /**
     * 指令名称
     */
    @Excel(name = "指令名称")
    private String orderName;

    /**
     * 所属产业类型（生物医药、食品、医疗器械）
     */
    @Excel(name = "所属产业类型", readConverterExp = "生物医药、食品、医疗器械")
    private String gmpIndustry;

    /**
     * 产品名称
     */
    @Excel(name = "产品名称")
    private String productName;

    /**
     * 产品批号
     */
    @Excel(name = "产品批号")
    private String productCode;

    /**
     * 批生产指令物料需求表
     */
    @Excel(name = "批生产指令物料需求表")
    private String productionMaterialCode;

    /**
     * 产品规格
     */
    @Excel(name = "产品规格")
    private String spec;

    /**
     * 计划产量
     */
    @Excel(name = "计划产量")
    private String plannedOutput;

    /**
     * 车间编码
     */
    @Excel(name = "车间编码")
    private String roomCode;

    /**
     * 批准人
     */
    @Excel(name = "批准人")
    private String approver;

    /**
     * 批准日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date approveDate;

    /**
     * 生产内容url
     */
    @Excel(name = "生产内容url")
    private String contentUrl;

    /**
     * 指令状态
     */
    @Excel(name = "指令状态")
    private Long orderStatus;

    /**
     * 派单状态
     */
    @Excel(name = "派单状态")
    //0-未派单 1-已派单、2-生产中、3-已完成 4-有异常
    private Long productionStatus;

    /**
     * 派单编码
     */
    @Excel(name = "派单编码")
    private String workOrderCode;

    /** 逻辑删除标记：0-未删除，1-已删除 */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer isDelete;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    public String getOrderName() {
        return orderName;
    }

    public void setGmpIndustry(String gmpIndustry) {
        this.gmpIndustry = gmpIndustry;
    }

    public String getGmpIndustry() {
        return gmpIndustry;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductionMaterialCode(String productionMaterialCode) {
        this.productionMaterialCode = productionMaterialCode;
    }

    public String getProductionMaterialCode() {
        return productionMaterialCode;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getSpec() {
        return spec;
    }

    public void setPlannedOutput(String plannedOutput) {
        this.plannedOutput = plannedOutput;
    }

    public String getPlannedOutput() {
        return plannedOutput;
    }

    public void setRoomCode(String roomCode) {
        this.roomCode = roomCode;
    }

    public String getRoomCode() {
        return roomCode;
    }

    public void setApprover(String approver) {
        this.approver = approver;
    }

    public String getApprover() {
        return approver;
    }

    public void setApproveDate(Date approveDate) {
        this.approveDate = approveDate;
    }

    public Date getApproveDate() {
        return approveDate;
    }

    public void setContentUrl(String contentUrl) {
        this.contentUrl = contentUrl;
    }

    public String getContentUrl() {
        return contentUrl;
    }

    public void setOrderStatus(Long orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Long getOrderStatus() {
        return orderStatus;
    }

    public void setProductionStatus(Long productionStatus) {
        this.productionStatus = productionStatus;
    }

    public Long getProductionStatus() {
        return productionStatus;
    }

    public void setWorkOrderCode(String workOrderCode) {
        this.workOrderCode = workOrderCode;
    }

    public String getWorkOrderCode() {
        return workOrderCode;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderCode", getOrderCode())
                .append("orderName", getOrderName())
                .append("gmpIndustry", getGmpIndustry())
                .append("productName", getProductName())
                .append("productCode", getProductCode())
                .append("productionMaterialCode", getProductionMaterialCode())
                .append("spec", getSpec())
                .append("plannedOutput", getPlannedOutput())
                .append("roomCode", getRoomCode())
                .append("approver", getApprover())
                .append("approveDate", getApproveDate())
                .append("contentUrl", getContentUrl())
                .append("remark", getRemark())
                .append("orderStatus", getOrderStatus())
                .append("productionStatus", getProductionStatus())
                .append("workOrderCode", getWorkOrderCode())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("isDelete", getIsDelete())
                .toString();
    }
}

